-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use assignments for enums in pillow #11959
Conversation
ROTATE_270: Literal[4] | ||
TRANSPOSE: Literal[5] | ||
TRANSVERSE: Literal[6] | ||
FLIP_LEFT_RIGHT: Final = 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried to use the enum value here like this FLIP_LEFT_RIGHT: Final = Transpose.FLIP_LEFT_RIGHT.value
but pytype complained.
This comment has been minimized.
This comment has been minimized.
stubs/Pillow/PIL/DdsImagePlugin.pyi
Outdated
UYVY = i32(b"UYVY") | ||
R8G8_B8G8 = i32(b"RGBG") | ||
YUY2 = i32(b"YUY2") | ||
G8R8_G8B8 = i32(b"GRGB") | ||
DXT1 = i32(b"DXT1") | ||
DXT2 = i32(b"DXT2") | ||
DXT3 = i32(b"DXT3") | ||
DXT4 = i32(b"DXT4") | ||
DXT5 = i32(b"DXT5") | ||
DX10 = i32(b"DX10") | ||
BC4S = i32(b"BC4S") | ||
BC4U = i32(b"BC4U") | ||
BC5S = i32(b"BC5S") | ||
BC5U = i32(b"BC5U") | ||
ATI1 = i32(b"ATI1") | ||
ATI2 = i32(b"ATI2") | ||
MULTI2_ARGB8 = i32(b"MET1") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder why none of our tests complained, but I doubt this will work. We just need to use the generated int
value and possibly add a comment with the "source" value.
According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉 |
Follow up to #11957 and #11956.
With this change, typeshed becomes ready for the change in the type checker behavior regarding unassigned enum attributes.
Edit: pygit2 changes have been split to a separate PR